home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Nave / goobers.swf / scripts / frame_92 / PlaceObject2_55_50 / CLIPACTIONRECORD onClipEvent(enterFrame).as next >
Encoding:
Text File  |  2007-03-28  |  2.1 KB  |  56 lines

  1. onClipEvent(enterFrame){
  2.    if(status != "game over")
  3.    {
  4.       this._x += (_parent._xmouse - this._x) / 3;
  5.       if(this._x - this._width / 2 < _parent.play_area._x - _parent.play_area._width / 2)
  6.       {
  7.          this._x = _parent.play_area._x - _parent.play_area._width / 2 + this._width / 2;
  8.       }
  9.       else if(_parent.play_area._x + _parent.play_area._width / 2 < this._x + this._width / 2)
  10.       {
  11.          this._x = _parent.play_area._x + _parent.play_area._width / 2 - this._width / 2;
  12.       }
  13.    }
  14.    if(status == "play")
  15.    {
  16.       if(_parent.num_enemy_ships == 0)
  17.       {
  18.          _parent.current_round = _parent.current_round + 1;
  19.          if(_parent.rounds < _parent.current_round)
  20.          {
  21.             _parent.create_boss(_parent.current_level,_parent.xctr,_parent.yctr);
  22.             _parent.current_level = _parent.current_level + 1;
  23.             _parent.current_round = 1;
  24.             status = "boss";
  25.          }
  26.          else if(_parent.current_round == _parent.rounds - 1)
  27.          {
  28.             _parent.bez_ship.active = true;
  29.             _parent.num_enemy_ships = 1;
  30.             status = "bez ship";
  31.          }
  32.          else
  33.          {
  34.             _parent.create_new_string(_parent.current_level,_parent.current_round,_parent.xctr,_parent.yctr,_parent.space_x,_parent.space_y,_parent.num_ships_x,_parent.num_ships_y);
  35.          }
  36.          num_fired = 0;
  37.          depth = 100;
  38.          var j = 0;
  39.          while(j < _parent.num_ships_x * _parent.num_ships_y)
  40.          {
  41.             enemies_left[j] = j;
  42.             j++;
  43.          }
  44.       }
  45.       frames++;
  46.       if(frames % (num_enemy_frames - _parent.current_round * 2 - _parent.current_level * 2) == 0)
  47.       {
  48.          _parent.enemy_bullet.duplicateMovieClip("enemy_bullet" + num_enemy_shots,num_enemy_shots + 50);
  49.          j = enemies_left[Math.floor(Math.random() * enemies_left.length)];
  50.          _parent["enemy_bullet" + num_enemy_shots].x = _parent["enemy" + j]._x;
  51.          _parent["enemy_bullet" + num_enemy_shots].y = _parent["enemy" + j]._y;
  52.          num_enemy_shots++;
  53.       }
  54.    }
  55. }
  56.